jQuery(document).ready(function() {
	
	//创建JQGRID表格
	
	var grid = $("#table1").ligerGrid({
        columns: [
                  { display: '物料编号', name: 'code', width: 150 },
                  { display: '物料名称', name: 'name', width: 100},
                  { display: '物料类型', name: 'maType', width: 150 },
                  { display: '型号', name: 'spec', width: 120},
                  { display: '单位', name: 'junit', width: 100 },
                  { display: '仓库', name: 'whName', width: 150},
                  { display: '批次', name: 'batch', width: 150},
                  { display: '物品状态', name: 'status', width: 100 ,render:function(row){
                	  if(row.status == '1'){
                		  return '一等';
                	  }else if(row.status == '2'){
                		  return '次品';
                	  }else if(row.status == '3'){
                		  return '旧品';
                	  }else if(row.status == '4'){
                		  return '冻结库存';
                	  }else if(row.status == '5'){
                		  return '在途库存';
                	  }
                  }},
                  { display: '本月期初', name: 'sumquantity', width: 100 ,render:function(row){
                	  
                	  if(row.sumquantity == null || row.sumquantity == ''){
                		  return '0.0';
                	  }
                	  return (row.sumquantity).toFixed(2);
                  }},
                  { display: '入库数量', name: 'rkquantity', width: 100 ,render:function(row){
                	  
                	  if(row.rkquantity == null || row.rkquantity == ''){
                		  return '0.0';
                	  }
                	  return (row.rkquantity).toFixed(2);
                  }},
                  { display: '出库数量', name: 'ckquantity', width: 100 ,render:function(row){
                	  
                	  if(row.ckquantity == null || row.ckquantity == ''){
                		  return '0.0';
                	  }
                	  return (row.ckquantity).toFixed(2);
                  }},
                  { display: '结余库存', name: 'jrkc', width: 100 ,render:function(row){
                	  
                	  if(row.jrkc == null || row.jrkc == ''){
                		  return '0.0';
                	  }
                	  return (row.jrkc).toFixed(2);
                  }},
                  { display: '建单时间', name: 'dctime', width: 100 ,hide:true,render: function (item){
            		  var cdate=new Date(item.dctime);
            		  return formatDate(cdate,"yyyy-MM-dd");
            	  }}
                      ],  usePager: true,pageSize:15,pageSizeOptions :[15,30,45,60],enabledSort:false,
                      url : basic_Url+"/listmon.do",
                      width: "100%", height:"98%", checkbox: false,rownumbers:true
                  });
	$("#pageloading").hide();
	
});
